const compress_images = require('compress-images');
const fs = require('fs-extra');
const path = require('path');

const INPUT_path_to_your_images =
  /* path.join(__dirname, '../') +  */ 'src/resource/assets/*.{jpg,JPG,jpeg,JPEG,png,svg,gif}';
// const INPUT_path_to_your_images = '../src/resource/images/**/*.{jpg,JPG,jpeg,JPEG,png,svg,gif}';

const OUTPUT_path = /* path.join(__dirname, '../') +  */ 'dist/imgs/';
// const OUTPUT_path = '../build/imgs/';

console.log(INPUT_path_to_your_images);
console.log(OUTPUT_path);

compress_images(
  INPUT_path_to_your_images,
  OUTPUT_path,
  { compress_force: false, statistic: true, autoupdate: true },
  false,
  { jpg: { engine: 'mozjpeg', command: ['-quality', '75'] } },
  { png: { engine: 'pngquant', command: ['--quality=75-76', '-o'] } },
  { svg: { engine: 'svgo', command: '--multipass' } },
  { gif: { engine: 'gifsicle', command: ['--colors', '64', '--use-col=web'] } },
  function (error, completed, statistic) {
    console.log('-------------');
    console.log(error);
    console.log(statistic);
    console.log('-------------');
  },
);
function add() {
  return 111;
}

function multpart() {
  // JIAYOU XIExie nidedaolai woshuode hua nidou buyuanyi shangchuang ma wobuxiangshuo ni le ni ziji kanzheban
  // jin tian tianqi bucuo o wo xiang yueni chulai mianshi nikan zen me yang ne woye buxiang tan ni de xiao pianyi
  // niting wode hua ma  wodou buxiang he nishuo zheme duo le  nijue de ni shuo de hai bugou duoma wo dou jintian he ni haohao
  // bai bai nishuo ni bu xihuan zhe ge gongzuo na ni xihuan nage ne renwu wanren  ni buyao zhe xiang zhe ziji zenyang zen yang
  // mei his  dou tingjian dan de  buxin nilai djia you xi   xni de daolai woshuo le nibuzhidao woede haochu shibua                ji jisd j
  // ji sdji ds  jiw       bushi shuohaod e nide buxi huan   ai ni odushi zhuma wo doushuole buxinhuan ni nihai shi yaolai gaowo
  // 真的不想说你了 你自己耗子未知 谢谢 拜拜咯 今天就说道这里啦 不打扰了 你自己过的好就行 我一个人也是一样走的 拜拜的点点滴滴多多多多单独搭所多ddddsddddsdfffddddsadsdd加鷄蛋
  // jiayou xiexie nide daola  o buyong xie xie nide da asd asd asd a
  // bushuo wodou zhidao nishi shabi  buyong zai shuo le  wozhidao nishi ge sha bi
}
